\(\int \frac {\sinh ^2(c+d x) \tanh (c+d x)}{a+b \sinh (c+d x)} \, dx\) [409]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 89 \[ \int \frac {\sinh ^2(c+d x) \tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {b \arctan (\sinh (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a \log (\cosh (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a^3 \log (a+b \sinh (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {\sinh (c+d x)}{b d} \]

[Out]

-b*arctan(sinh(d*x+c))/(a^2+b^2)/d-a*ln(cosh(d*x+c))/(a^2+b^2)/d-a^3*ln(a+b*sinh(d*x+c))/b^2/(a^2+b^2)/d+sinh(
d*x+c)/b/d

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2916, 12, 1643, 649, 209, 266} \[ \int \frac {\sinh ^2(c+d x) \tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {b \arctan (\sinh (c+d x))}{d \left (a^2+b^2\right )}-\frac {a \log (\cosh (c+d x))}{d \left (a^2+b^2\right )}-\frac {a^3 \log (a+b \sinh (c+d x))}{b^2 d \left (a^2+b^2\right )}+\frac {\sinh (c+d x)}{b d} \]

[In]

Int[(Sinh[c + d*x]^2*Tanh[c + d*x])/(a + b*Sinh[c + d*x]),x]

[Out]

-((b*ArcTan[Sinh[c + d*x]])/((a^2 + b^2)*d)) - (a*Log[Cosh[c + d*x]])/((a^2 + b^2)*d) - (a^3*Log[a + b*Sinh[c
+ d*x]])/(b^2*(a^2 + b^2)*d) + Sinh[c + d*x]/(b*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 649

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[(-a)*c]

Rule 1643

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*
Pq*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 2916

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {b \text {Subst}\left (\int \frac {x^3}{b^3 (a+x) \left (-b^2-x^2\right )} \, dx,x,b \sinh (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \frac {x^3}{(a+x) \left (-b^2-x^2\right )} \, dx,x,b \sinh (c+d x)\right )}{b^2 d} \\ & = -\frac {\text {Subst}\left (\int \left (-1+\frac {a^3}{\left (a^2+b^2\right ) (a+x)}+\frac {b^4+a b^2 x}{\left (a^2+b^2\right ) \left (b^2+x^2\right )}\right ) \, dx,x,b \sinh (c+d x)\right )}{b^2 d} \\ & = -\frac {a^3 \log (a+b \sinh (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {\sinh (c+d x)}{b d}-\frac {\text {Subst}\left (\int \frac {b^4+a b^2 x}{b^2+x^2} \, dx,x,b \sinh (c+d x)\right )}{b^2 \left (a^2+b^2\right ) d} \\ & = -\frac {a^3 \log (a+b \sinh (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {\sinh (c+d x)}{b d}-\frac {a \text {Subst}\left (\int \frac {x}{b^2+x^2} \, dx,x,b \sinh (c+d x)\right )}{\left (a^2+b^2\right ) d}-\frac {b^2 \text {Subst}\left (\int \frac {1}{b^2+x^2} \, dx,x,b \sinh (c+d x)\right )}{\left (a^2+b^2\right ) d} \\ & = -\frac {b \arctan (\sinh (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a \log (\cosh (c+d x))}{\left (a^2+b^2\right ) d}-\frac {a^3 \log (a+b \sinh (c+d x))}{b^2 \left (a^2+b^2\right ) d}+\frac {\sinh (c+d x)}{b d} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.15 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.02 \[ \int \frac {\sinh ^2(c+d x) \tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {\frac {\log (i-\sinh (c+d x))}{a+i b}+\frac {\log (i+\sinh (c+d x))}{a-i b}+\frac {2 a^3 \log (a+b \sinh (c+d x))}{b^2 \left (a^2+b^2\right )}-\frac {2 \sinh (c+d x)}{b}}{2 d} \]

[In]

Integrate[(Sinh[c + d*x]^2*Tanh[c + d*x])/(a + b*Sinh[c + d*x]),x]

[Out]

-1/2*(Log[I - Sinh[c + d*x]]/(a + I*b) + Log[I + Sinh[c + d*x]]/(a - I*b) + (2*a^3*Log[a + b*Sinh[c + d*x]])/(
b^2*(a^2 + b^2)) - (2*Sinh[c + d*x])/b)/d

Maple [A] (verified)

Time = 1.60 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.90

method result size
derivativedivides \(\frac {-\frac {a^{3} \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{b^{2} \left (a^{2}+b^{2}\right )}-\frac {1}{b \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}+\frac {-8 a \ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )-16 b \arctan \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a^{2}+8 b^{2}}-\frac {1}{b \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}}{d}\) \(169\)
default \(\frac {-\frac {a^{3} \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}{b^{2} \left (a^{2}+b^{2}\right )}-\frac {1}{b \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}+\frac {-8 a \ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )-16 b \arctan \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a^{2}+8 b^{2}}-\frac {1}{b \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}}{d}\) \(169\)
risch \(-\frac {a x}{b^{2}}+\frac {{\mathrm e}^{d x +c}}{2 b d}-\frac {{\mathrm e}^{-d x -c}}{2 b d}+\frac {2 a \,d^{2} x}{a^{2} d^{2}+b^{2} d^{2}}+\frac {2 a d c}{a^{2} d^{2}+b^{2} d^{2}}+\frac {2 a^{3} x}{b^{2} \left (a^{2}+b^{2}\right )}+\frac {2 a^{3} c}{b^{2} d \left (a^{2}+b^{2}\right )}+\frac {i \ln \left ({\mathrm e}^{d x +c}-i\right ) b}{\left (a^{2}+b^{2}\right ) d}-\frac {\ln \left ({\mathrm e}^{d x +c}-i\right ) a}{\left (a^{2}+b^{2}\right ) d}-\frac {i \ln \left ({\mathrm e}^{d x +c}+i\right ) b}{\left (a^{2}+b^{2}\right ) d}-\frac {\ln \left ({\mathrm e}^{d x +c}+i\right ) a}{\left (a^{2}+b^{2}\right ) d}-\frac {a^{3} \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {2 a \,{\mathrm e}^{d x +c}}{b}-1\right )}{b^{2} d \left (a^{2}+b^{2}\right )}\) \(271\)

[In]

int(sinh(d*x+c)^2*tanh(d*x+c)/(a+b*sinh(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-a^3/b^2/(a^2+b^2)*ln(tanh(1/2*d*x+1/2*c)^2*a-2*b*tanh(1/2*d*x+1/2*c)-a)-1/b/(tanh(1/2*d*x+1/2*c)+1)+a/b^
2*ln(tanh(1/2*d*x+1/2*c)+1)+16/(8*a^2+8*b^2)*(-1/2*a*ln(1+tanh(1/2*d*x+1/2*c)^2)-b*arctan(tanh(1/2*d*x+1/2*c))
)-1/b/(tanh(1/2*d*x+1/2*c)-1)+a/b^2*ln(tanh(1/2*d*x+1/2*c)-1))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 288 vs. \(2 (89) = 178\).

Time = 0.27 (sec) , antiderivative size = 288, normalized size of antiderivative = 3.24 \[ \int \frac {\sinh ^2(c+d x) \tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {2 \, {\left (a^{3} + a b^{2}\right )} d x \cosh \left (d x + c\right ) - a^{2} b - b^{3} + {\left (a^{2} b + b^{3}\right )} \cosh \left (d x + c\right )^{2} + {\left (a^{2} b + b^{3}\right )} \sinh \left (d x + c\right )^{2} - 4 \, {\left (b^{3} \cosh \left (d x + c\right ) + b^{3} \sinh \left (d x + c\right )\right )} \arctan \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right )\right ) - 2 \, {\left (a^{3} \cosh \left (d x + c\right ) + a^{3} \sinh \left (d x + c\right )\right )} \log \left (\frac {2 \, {\left (b \sinh \left (d x + c\right ) + a\right )}}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) - 2 \, {\left (a b^{2} \cosh \left (d x + c\right ) + a b^{2} \sinh \left (d x + c\right )\right )} \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) + 2 \, {\left ({\left (a^{3} + a b^{2}\right )} d x + {\left (a^{2} b + b^{3}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )}{2 \, {\left ({\left (a^{2} b^{2} + b^{4}\right )} d \cosh \left (d x + c\right ) + {\left (a^{2} b^{2} + b^{4}\right )} d \sinh \left (d x + c\right )\right )}} \]

[In]

integrate(sinh(d*x+c)^2*tanh(d*x+c)/(a+b*sinh(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(2*(a^3 + a*b^2)*d*x*cosh(d*x + c) - a^2*b - b^3 + (a^2*b + b^3)*cosh(d*x + c)^2 + (a^2*b + b^3)*sinh(d*x
+ c)^2 - 4*(b^3*cosh(d*x + c) + b^3*sinh(d*x + c))*arctan(cosh(d*x + c) + sinh(d*x + c)) - 2*(a^3*cosh(d*x + c
) + a^3*sinh(d*x + c))*log(2*(b*sinh(d*x + c) + a)/(cosh(d*x + c) - sinh(d*x + c))) - 2*(a*b^2*cosh(d*x + c) +
 a*b^2*sinh(d*x + c))*log(2*cosh(d*x + c)/(cosh(d*x + c) - sinh(d*x + c))) + 2*((a^3 + a*b^2)*d*x + (a^2*b + b
^3)*cosh(d*x + c))*sinh(d*x + c))/((a^2*b^2 + b^4)*d*cosh(d*x + c) + (a^2*b^2 + b^4)*d*sinh(d*x + c))

Sympy [F]

\[ \int \frac {\sinh ^2(c+d x) \tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=\int \frac {\sinh ^{2}{\left (c + d x \right )} \tanh {\left (c + d x \right )}}{a + b \sinh {\left (c + d x \right )}}\, dx \]

[In]

integrate(sinh(d*x+c)**2*tanh(d*x+c)/(a+b*sinh(d*x+c)),x)

[Out]

Integral(sinh(c + d*x)**2*tanh(c + d*x)/(a + b*sinh(c + d*x)), x)

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.65 \[ \int \frac {\sinh ^2(c+d x) \tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {a^{3} \log \left (-2 \, a e^{\left (-d x - c\right )} + b e^{\left (-2 \, d x - 2 \, c\right )} - b\right )}{{\left (a^{2} b^{2} + b^{4}\right )} d} + \frac {2 \, b \arctan \left (e^{\left (-d x - c\right )}\right )}{{\left (a^{2} + b^{2}\right )} d} - \frac {a \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{{\left (a^{2} + b^{2}\right )} d} - \frac {{\left (d x + c\right )} a}{b^{2} d} + \frac {e^{\left (d x + c\right )}}{2 \, b d} - \frac {e^{\left (-d x - c\right )}}{2 \, b d} \]

[In]

integrate(sinh(d*x+c)^2*tanh(d*x+c)/(a+b*sinh(d*x+c)),x, algorithm="maxima")

[Out]

-a^3*log(-2*a*e^(-d*x - c) + b*e^(-2*d*x - 2*c) - b)/((a^2*b^2 + b^4)*d) + 2*b*arctan(e^(-d*x - c))/((a^2 + b^
2)*d) - a*log(e^(-2*d*x - 2*c) + 1)/((a^2 + b^2)*d) - (d*x + c)*a/(b^2*d) + 1/2*e^(d*x + c)/(b*d) - 1/2*e^(-d*
x - c)/(b*d)

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.63 \[ \int \frac {\sinh ^2(c+d x) \tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {\frac {2 \, a^{3} \log \left ({\left | b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )} + 2 \, a \right |}\right )}{a^{2} b^{2} + b^{4}} + \frac {{\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )} e^{\left (-d x - c\right )}\right )\right )} b}{a^{2} + b^{2}} + \frac {a \log \left ({\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{2} + 4\right )}{a^{2} + b^{2}} - \frac {e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}}{b}}{2 \, d} \]

[In]

integrate(sinh(d*x+c)^2*tanh(d*x+c)/(a+b*sinh(d*x+c)),x, algorithm="giac")

[Out]

-1/2*(2*a^3*log(abs(b*(e^(d*x + c) - e^(-d*x - c)) + 2*a))/(a^2*b^2 + b^4) + (pi + 2*arctan(1/2*(e^(2*d*x + 2*
c) - 1)*e^(-d*x - c)))*b/(a^2 + b^2) + a*log((e^(d*x + c) - e^(-d*x - c))^2 + 4)/(a^2 + b^2) - (e^(d*x + c) -
e^(-d*x - c))/b)/d

Mupad [B] (verification not implemented)

Time = 2.53 (sec) , antiderivative size = 249, normalized size of antiderivative = 2.80 \[ \int \frac {\sinh ^2(c+d x) \tanh (c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {{\mathrm {e}}^{c+d\,x}}{2\,b\,d}-\frac {\ln \left ({\mathrm {e}}^{c+d\,x}+1{}\mathrm {i}\right )}{a\,d-b\,d\,1{}\mathrm {i}}-\frac {a^3\,\ln \left (2\,a^4\,b^3-b^7-a^2\,b^5-a^6\,b+2\,a^7\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c+b^7\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+a^6\,b\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+2\,a^3\,b^4\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c-4\,a^5\,b^2\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c+a^2\,b^5\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}-2\,a^4\,b^3\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+2\,a\,b^6\,{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\right )}{d\,a^2\,b^2+d\,b^4}-\frac {{\mathrm {e}}^{-c-d\,x}}{2\,b\,d}+\frac {a\,x}{b^2}-\frac {\ln \left (1+{\mathrm {e}}^{c+d\,x}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{-b\,d+a\,d\,1{}\mathrm {i}} \]

[In]

int((sinh(c + d*x)^2*tanh(c + d*x))/(a + b*sinh(c + d*x)),x)

[Out]

exp(c + d*x)/(2*b*d) - (log(exp(c + d*x)*1i + 1)*1i)/(a*d*1i - b*d) - log(exp(c + d*x) + 1i)/(a*d - b*d*1i) -
(a^3*log(2*a^4*b^3 - b^7 - a^2*b^5 - a^6*b + 2*a^7*exp(d*x)*exp(c) + b^7*exp(2*c)*exp(2*d*x) + a^6*b*exp(2*c)*
exp(2*d*x) + 2*a^3*b^4*exp(d*x)*exp(c) - 4*a^5*b^2*exp(d*x)*exp(c) + a^2*b^5*exp(2*c)*exp(2*d*x) - 2*a^4*b^3*e
xp(2*c)*exp(2*d*x) + 2*a*b^6*exp(d*x)*exp(c)))/(b^4*d + a^2*b^2*d) - exp(- c - d*x)/(2*b*d) + (a*x)/b^2